/*
 *  Copyright 2019 Sergey Khabarov, sergeykhbr@gmail.com
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

#ifndef __BOOTROM_TESTS_SRC_TEST_FPU_H__
#define __BOOTROM_TESTS_SRC_TEST_FPU_H__

#include <inttypes.h>

typedef union Reg64Type {
    double f64;
    int64_t ival;
    uint64_t val;
    int32_t ibuf32[2];
    uint32_t buf32[2];
} Reg64Type;

typedef struct FpuTestType {
    uint64_t a;
    uint64_t b;
    uint64_t res;
} FpuTestType;

#define ENABLE_FADD_TESTS
//#define ENABLE_FSUB_TESTS
//#define ENABLE_FDIV_TESTS
#define ENABLE_FMUL_TESTS
//#define ENABLE_FMAX_TESTS
#define ENABLE_FCVT_D_W_TESTS
#define ENABLE_FCVT_D_WU_TESTS
#define ENABLE_FCVT_W_D_TESTS
#define ENABLE_FCVT_WU_D_TESTS

#ifdef ENABLE_FADD_TESTS
static const FpuTestType FADD_TESTS[] = {
    {0x801a849d8a54ce7a, 0x001ec52a673d103b, 0x0004408cdce841c1},
    {0x4024a5604189374c, 0xc015554c985f06f7, 0x4013f573eab367a1},
    {0xfffcfae57723852f, 0xfff2bb91c297ea7c, 0xfffabb91c297ea7c},
    {0x7ffdd92a4fa86188, 0xfff527d430c40dfb, 0xfffd27d430c40dfb},
    {0xfff83dbe1a26a815, 0xffff0d13540abcd1, 0xffff0d13540abcd1},
    {0x0000000000000000, 0xc17312d000000000, 0xc17312d000000000},
    {0x0000000000000000, 0xc060000000000000, 0xc060000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x413458550295fc56},
    {0x0000000000000000, 0x4060000000000000, 0x4060000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x0000000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x4136705100000000, 0xffff000000001100},
    {0x4179062540000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000002},
    {0x0000000000000000, 0xc17312d000000000, 0xc17312d000000000},
    {0x0000000000000000, 0xc060000000000000, 0xc060000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x413458550295fc56},
    {0x0000000000000000, 0x4060000000000000, 0x4060000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x0000000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41c41df778800000, 0xffff000000001100},
    {0x41b0ed4e1a000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000002},
    {0x0000000000000000, 0xc17312d000000000, 0xc17312d000000000},
    {0x0000000000000000, 0xc060000000000000, 0xc060000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x413458550295fc56},
    {0x0000000000000000, 0x4060000000000000, 0x4060000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x0000000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41aff797ea000000, 0xffff000000001100},
    {0x4181d2dfa0000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000002},
    {0x0000000000000000, 0xc17312d000000000, 0xc17312d000000000},
    {0x0000000000000000, 0xc060000000000000, 0xc060000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x413458550295fc56},
    {0x0000000000000000, 0x4060000000000000, 0x4060000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x0000000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x4194a25ef0000000, 0xffff000000001100},
    {0x41b21edc2c000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000002},
    {0x0000000000000001, 0xc17312d000000000, 0xc17312d000000000},
    {0x0000000000000001, 0xc060000000000000, 0xc060000000000000},
    {0x0000000000000001, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x0000000000000001, 0x0000000000000000, 0x0000000000000001},
    {0x0000000000000001, 0x413458550295fc56, 0x413458550295fc56},
    {0x0000000000000001, 0x4060000000000000, 0x4060000000000000},
    {0x0000000000000001, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000002},
    {0xc17312d000000000, 0x0000000000000001, 0xc17312d000000000},
    {0xc060000000000000, 0x0000000000000001, 0xc060000000000000},
    {0x0000000000000000, 0x0000000000000001, 0x0000000000000001},
    {0x413458550295fc56, 0x0000000000000001, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000000000001, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000000000000001, 0x3ff0000000000000},
    {0xffff000000001100, 0x41930f4ff4000000, 0xffff000000001100},
    {0x41a066b6cc000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000002},
    {0x0000000000008000, 0xc17312d000000000, 0xc17312d000000000},
    {0x0000000000008000, 0xc060000000000000, 0xc060000000000000},
    {0x0000000000008000, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x0000000000008000, 0x0000000000000000, 0x0000000000008000},
    {0x0000000000008000, 0x413458550295fc56, 0x413458550295fc56},
    {0x0000000000008000, 0x4060000000000000, 0x4060000000000000},
    {0x0000000000008000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0000000000008000, 0x0000000000008000, 0x0000000000010000},
    {0xc17312d000000000, 0x0000000000008000, 0xc17312d000000000},
    {0xc060000000000000, 0x0000000000008000, 0xc060000000000000},
    {0x0000000000000000, 0x0000000000008000, 0x0000000000008000},
    {0x413458550295fc56, 0x0000000000008000, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000000008000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000000000008000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41b3001ab4000000, 0xffff000000001100},
    {0x41b8d4ee24000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000002},
    {0x0000200000000000, 0xc17312d000000000, 0xc17312d000000000},
    {0x0000200000000000, 0xc060000000000000, 0xc060000000000000},
    {0x0000200000000000, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x0000200000000000, 0x0000000000000000, 0x0000200000000000},
    {0x0000200000000000, 0x413458550295fc56, 0x413458550295fc56},
    {0x0000200000000000, 0x4060000000000000, 0x4060000000000000},
    {0x0000200000000000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0000200000000000, 0x0000200000000000, 0x0000400000000000},
    {0xc17312d000000000, 0x0000200000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x0000200000000000, 0xc060000000000000},
    {0x0000000000000000, 0x0000200000000000, 0x0000200000000000},
    {0x413458550295fc56, 0x0000200000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x0000200000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000200000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41b4534397000000, 0xffff000000001100},
    {0x419fbe86b4000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000002},
    {0x0008000000000000, 0xc17312d000000000, 0xc17312d000000000},
    {0x0008000000000000, 0xc060000000000000, 0xc060000000000000},
    {0x0008000000000000, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x0008000000000000, 0x0000000000000000, 0x0008000000000000},
    {0x0008000000000000, 0x413458550295fc56, 0x413458550295fc56},
    {0x0008000000000000, 0x4060000000000000, 0x4060000000000000},
    {0x0008000000000000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0008000000000000, 0x0008000000000000, 0x0010000000000000},
    {0xc17312d000000000, 0x0008000000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x0008000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x0008000000000000, 0x0008000000000000},
    {0x413458550295fc56, 0x0008000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x0008000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0008000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41c0e84354000000, 0xffff000000001100},
    {0x41a5538ba2000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000002},
    {0x0000000000000002, 0xc17312d000000000, 0xc17312d000000000},
    {0x0000000000000002, 0xc060000000000000, 0xc060000000000000},
    {0x0000000000000002, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x0000000000000002, 0x0000000000000000, 0x0000000000000002},
    {0x0000000000000002, 0x413458550295fc56, 0x413458550295fc56},
    {0x0000000000000002, 0x4060000000000000, 0x4060000000000000},
    {0x0000000000000002, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0000000000000002, 0x0000000000000002, 0x0000000000000004},
    {0xc17312d000000000, 0x0000000000000002, 0xc17312d000000000},
    {0xc060000000000000, 0x0000000000000002, 0xc060000000000000},
    {0x0000000000000000, 0x0000000000000002, 0x0000000000000002},
    {0x413458550295fc56, 0x0000000000000002, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000000000002, 0x4060000000000000},
    {0x39e0000000000000, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x39e0000000000000, 0x0000000000000000, 0x39e0000000000000},
    {0x39e0000000000000, 0x413458550295fc56, 0x413458550295fc56},
    {0x39e0000000000000, 0x4060000000000000, 0x4060000000000000},
    {0x39e0000000000000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x39e0000000000000, 0x39e0000000000000, 0x39f0000000000000},
    {0xc17312d000000000, 0x39e0000000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x39e0000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x39e0000000000000, 0x39e0000000000000},
    {0x413458550295fc56, 0x39e0000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x39e0000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x39e0000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41c4113938000000, 0xffff000000001100},
    {0x41c2b89595000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000002},
    {0x000000000000073d, 0xc17312d000000000, 0xc17312d000000000},
    {0x000000000000073d, 0xc060000000000000, 0xc060000000000000},
    {0x000000000000073d, 0xbeb0c6f7a0b5ed8d, 0xbeb0c6f7a0b5ed8d},
    {0x000000000000073d, 0x0000000000000000, 0x000000000000073d},
    {0x000000000000073d, 0x413458550295fc56, 0x413458550295fc56},
    {0x000000000000073d, 0x4060000000000000, 0x4060000000000000},
    {0x000000000000073d, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x000000000000073d, 0x000000000000073d, 0x0000000000000e7a}
};
const size_t FADD_LENGTH = sizeof(FADD_TESTS) / sizeof(FpuTestType);
#endif  // ENABLE_FADD_TESTS


#ifdef ENABLE_FSUB_TESTS
static const FpuTestType FSUB_TESTS[] = {
    {0x00105e0a0bd63fed, 0x000505eb1ff6d966, 0x000b581eebdf6687},
    {0x804f7a5d3ab03b45, 0x804e9d581da2d710, 0x8006e828e86b21a8},
    {0x803bfbf92cbbb686, 0x803c965ddb436c66, 0x00026992ba1ed780},
    {0x804aa735a1b3462b, 0x804ad0d9a315d165, 0x00014d200b1459d0},
    {0x0000000000000000, 0x3ff0000000000000, 0xbff0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x0000000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41aff797ea000000, 0xffff000000001100},
    {0x4181d2dfa0000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000000000000000, 0xc17312d000000000, 0x417312d000000000},
    {0x0000000000000000, 0xc060000000000000, 0x4060000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0x3eb0c6f7a0b5ed8d},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0xc13458550295fc56},
    {0x0000000000000000, 0x4060000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0xbff0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x0000000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x4194a25ef0000000, 0xffff000000001100},
    {0x41b21edc2c000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x4060000000000000, 0x0000000000000001, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000000000000001, 0x3ff0000000000000},
    {0xffff000000001100, 0x41930f4ff4000000, 0xffff000000001100},
    {0x41a066b6cc000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000000000008000, 0xc17312d000000000, 0x417312d000000000},
    {0x0000000000008000, 0xc060000000000000, 0x4060000000000000},
    {0x0000000000008000, 0xbeb0c6f7a0b5ed8d, 0x3eb0c6f7a0b5ed8d},
    {0x0000000000008000, 0x0000000000000000, 0x0000000000008000},
    {0x0000000000008000, 0x413458550295fc56, 0xc13458550295fc56},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000200000000000, 0xc17312d000000000, 0x417312d000000000},
    {0x0000200000000000, 0xc060000000000000, 0x4060000000000000},
    {0x0000200000000000, 0xbeb0c6f7a0b5ed8d, 0x3eb0c6f7a0b5ed8d},
    {0x0000200000000000, 0x0000000000000000, 0x0000200000000000},
    {0x0000200000000000, 0x413458550295fc56, 0xc13458550295fc56},
    {0x0000200000000000, 0x4060000000000000, 0xc060000000000000},
    {0x0000200000000000, 0x3ff0000000000000, 0xbff0000000000000},
    {0x0000200000000000, 0x0000200000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000200000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x0000200000000000, 0xc060000000000000},
    {0x0000000000000000, 0x0000200000000000, 0x8000200000000000},
    {0x413458550295fc56, 0x0000200000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x0000200000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000200000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41b4534397000000, 0xffff000000001100},
    {0x419fbe86b4000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0008000000000000, 0xc17312d000000000, 0x417312d000000000},
    {0x0008000000000000, 0xc060000000000000, 0x4060000000000000},
    {0x0008000000000000, 0xbeb0c6f7a0b5ed8d, 0x3eb0c6f7a0b5ed8d},
    {0x0008000000000000, 0x0000000000000000, 0x0008000000000000},
    {0x0008000000000000, 0x413458550295fc56, 0xc13458550295fc56},
    {0x0008000000000000, 0x4060000000000000, 0xc060000000000000},
    {0x0008000000000000, 0x3ff0000000000000, 0xbff0000000000000},
    {0x0008000000000000, 0x0008000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0008000000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x0008000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x0008000000000000, 0x8008000000000000},
    {0x413458550295fc56, 0x0008000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x0008000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0008000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41c0e84354000000, 0xffff000000001100},
    {0x41a5538ba2000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000000000000002, 0xc17312d000000000, 0x417312d000000000},
    {0x0000000000000002, 0xc060000000000000, 0x4060000000000000},
    {0x0000000000000002, 0xbeb0c6f7a0b5ed8d, 0x3eb0c6f7a0b5ed8d},
    {0x0000000000000002, 0x0000000000000000, 0x0000000000000002},
    {0x0000000000000002, 0x413458550295fc56, 0xc13458550295fc56},
    {0x0000000000000002, 0x4060000000000000, 0xc060000000000000},
    {0x0000000000000002, 0x3ff0000000000000, 0xbff0000000000000},
    {0x0000000000000002, 0x0000000000000002, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000002, 0xc17312d000000000},
    {0xc060000000000000, 0x0000000000000002, 0xc060000000000000},
    {0x0000000000000000, 0x0000000000000002, 0x8000000000000002},
    {0x413458550295fc56, 0x0000000000000002, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000000000002, 0x4060000000000000},
    {0x39e0000000000000, 0xbeb0c6f7a0b5ed8d, 0x3eb0c6f7a0b5ed8d},
    {0x39e0000000000000, 0x0000000000000000, 0x39e0000000000000},
    {0x39e0000000000000, 0x413458550295fc56, 0xc13458550295fc56},
    {0x39e0000000000000, 0x4060000000000000, 0xc060000000000000},
    {0x39e0000000000000, 0x3ff0000000000000, 0xbff0000000000000},
    {0x39e0000000000000, 0x39e0000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x39e0000000000000, 0xc17312d000000000},
    {0xc060000000000000, 0x39e0000000000000, 0xc060000000000000},
    {0x0000000000000000, 0x39e0000000000000, 0xb9e0000000000000},
    {0x413458550295fc56, 0x39e0000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x39e0000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x39e0000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41c4113938000000, 0xffff000000001100},
    {0x41c2b89595000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x000000000000073d, 0xc17312d000000000, 0x417312d000000000},
    {0x000000000000073d, 0xc060000000000000, 0x4060000000000000},
    {0x000000000000073d, 0xbeb0c6f7a0b5ed8d, 0x3eb0c6f7a0b5ed8d},
    {0x000000000000073d, 0x0000000000000000, 0x000000000000073d},
    {0x000000000000073d, 0x413458550295fc56, 0xc13458550295fc56},
    {0x000000000000073d, 0x4060000000000000, 0xc060000000000000},
    {0x000000000000073d, 0x3ff0000000000000, 0xbff0000000000000},
    {0x000000000000073d, 0x000000000000073d, 0x0000000000000000}
};
const size_t FSUB_LENGTH = sizeof(FSUB_TESTS) / sizeof(FpuTestType);
#endif  // ENABLE_FSUB_TESTS


#ifdef ENABLE_FDIV_TESTS
static const FpuTestType FDIV_TESTS[] = {
    {0xc17312d000000000, 0x0000000000000001, 0xfff0000000000000},
    {0x4024a5604189374c, 0xc015554c985f06f7, 0xbffef81d11a8c890},
    {0x0000000000000000, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000000, 0xc060000000000000, 0x8000000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000000, 0x4060000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0xfff0000000000000},
    {0xc060000000000000, 0x0000000000000000, 0xfff0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x7ff0000000000000},
    {0x4060000000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0xffff000000001100, 0x4136705100000000, 0xffff000000001100},
    {0x4179062540000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x410b543a8f5c28f6, 0x400f374bc6a7ef9e, 0x40ec03f0f9d53957},
    {0x3fd2b020c49ba5e3, 0x410a67cc51eb851e, 0x3eb6a5be5f15d8c6},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x0000000000000000, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000000, 0xc060000000000000, 0x8000000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000000, 0x4060000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0xfff0000000000000},
    {0xc060000000000000, 0x0000000000000000, 0xfff0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x7ff0000000000000},
    {0x4060000000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0xffff000000001100, 0x41cc509cf9000000, 0xffff000000001100},
    {0x4190d62860000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x411a6f79f5c28f5c, 0x401b78d4fdf3b646, 0x40eecae86a28419a},
    {0x403ba4dd2f1a9fbf, 0x412169da47ae147b, 0x3f09666bc9d8f970},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x0000000000000000, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000000, 0xc060000000000000, 0x8000000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000000, 0x4060000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0xfff0000000000000},
    {0xc060000000000000, 0x0000000000000000, 0xfff0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x7ff0000000000000},
    {0x4060000000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0xffff000000001100, 0x41c28668a8000000, 0xffff000000001100},
    {0x41997e1c88000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x410cb99c00000000, 0x402e03126e978d50, 0x40cea0b6b5fe9125},
    {0x4038649ba5e353f8, 0x40ee43f1eb851eb8, 0x3f39ca80b9045b6f},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x0000000000000000, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000000, 0xc060000000000000, 0x8000000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000000, 0x4060000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0xfff0000000000000},
    {0xc060000000000000, 0x0000000000000000, 0xfff0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0xfff8000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x7ff0000000000000},
    {0x4060000000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0xffff000000001100, 0x4180006560000000, 0xffff000000001100},
    {0x41930f4ff4000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x40f15cbdeb851eb8, 0x403da872b020c49c, 0x40a2bbbab4558ec9},
    {0x4023dc28f5c28f5c, 0x410dce91851eb851, 0x3f05523c42c3cd3c},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x0000000000000001, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000001, 0xc060000000000000, 0x8000000000000000},
    {0x0000000000000001, 0xbeb0c6f7a0b5ed8d, 0x80000000000f4240},
    {0x0000000000000001, 0x0000000000000000, 0x7ff0000000000000},
    {0x0000000000000001, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000001, 0x4060000000000000, 0x0000000000000000},
    {0x0000000000000001, 0x3ff0000000000000, 0x0000000000000001},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0xc060000000000000, 0x0000000000000001, 0xfff0000000000000},
    {0x0000000000000000, 0x0000000000000001, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000001, 0x7ff0000000000000},
    {0x4060000000000000, 0x0000000000000001, 0x7ff0000000000000},
    {0x3ff0000000000000, 0x0000000000000001, 0x7ff0000000000000},
    {0xffff000000001100, 0x41b8d4ee24000000, 0xffff000000001100},
    {0x41b5f5621a000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x41068da947ae147b, 0x403b59999999999a, 0x40ba634a09ebf823},
    {0x4030f0e560418937, 0x411729f91eb851eb, 0x3f07673bb4e0d94f},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x0000000000008000, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000008000, 0xc060000000000000, 0x8000000000000100},
    {0x0000000000008000, 0xbeb0c6f7a0b5ed8d, 0x80000007a1200000},
    {0x0000000000008000, 0x0000000000000000, 0x7ff0000000000000},
    {0x0000000000008000, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000008000, 0x4060000000000000, 0x0000000000000100},
    {0x0000000000008000, 0x3ff0000000000000, 0x0000000000008000},
    {0x0000000000008000, 0x0000000000008000, 0x3ff0000000000000},
    {0xc17312d000000000, 0x0000000000008000, 0xfff0000000000000},
    {0xc060000000000000, 0x0000000000008000, 0xfff0000000000000},
    {0x0000000000000000, 0x0000000000008000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000008000, 0x7ff0000000000000},
    {0x4060000000000000, 0x0000000000008000, 0x7ff0000000000000},
    {0x3ff0000000000000, 0x0000000000008000, 0x7ff0000000000000},
    {0xffff000000001100, 0x41a3190398000000, 0xffff000000001100},
    {0x41a97e881c000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x40caf28000000000, 0x40404ba5e353f7cf, 0x407a756758e8f21f},
    {0x3ffa7ae147ae147b, 0x41129062cccccccc, 0x3ed6d299bab7c4f5},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x3ff0000000000000, 0x58c8000000000000, 0x2715555555555555},
    {0xffff000000001100, 0x41b9c0d8c0000000, 0xffff000000001100},
    {0x41b72aa22a000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x4113d77feb851eb8, 0x403070a3d70a3d71, 0x40d34f8d5059b184},
    {0x4031020c49ba5e35, 0x4104dfa2e147ae14, 0x3f1a12ec5266ddf7},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x0000000000000b1a, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000b1a, 0xc060000000000000, 0x8000000000000016},
    {0x0000000000000b1a, 0xbeb0c6f7a0b5ed8d, 0x80000000a9657a80},
    {0x0000000000000b1a, 0x0000000000000000, 0x7ff0000000000000},
    {0x0000000000000b1a, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000b1a, 0x4060000000000000, 0x0000000000000016},
    {0x0000000000000b1a, 0x3ff0000000000000, 0x0000000000000b1a},
    {0x0000000000000b1a, 0x0000000000000b1a, 0x3ff0000000000000},
    {0xc17312d000000000, 0x0000000000000b1a, 0xfff0000000000000},
    {0xc060000000000000, 0x0000000000000b1a, 0xfff0000000000000},
    {0x0000000000000000, 0x0000000000000b1a, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000b1a, 0x7ff0000000000000},
    {0x4060000000000000, 0x0000000000000b1a, 0x7ff0000000000000},
    {0x3ff0000000000000, 0x0000000000000b1a, 0x7ff0000000000000},
    {0xffff000000001100, 0x419a6be460000000, 0xffff000000001100},
    {0x41a00fb4bc000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x410b4b9b0a3d70a4, 0x40392d916872b021, 0x40c158739b0e5619},
    {0x40325ef9db22d0e5, 0x40e79ecdc28f5c29, 0x3f38e36dc402287e},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x00000000058d0000, 0xc17312d000000000, 0x8000000000000005},
    {0x00000000058d0000, 0xc060000000000000, 0x80000000000b1a00},
    {0x00000000058d0000, 0xbeb0c6f7a0b5ed8d, 0x800054b2bd400000},
    {0x00000000058d0000, 0x0000000000000000, 0x7ff0000000000000},
    {0x00000000058d0000, 0x413458550295fc56, 0x0000000000000046},
    {0x00000000058d0000, 0x4060000000000000, 0x00000000000b1a00},
    {0x00000000058d0000, 0x3ff0000000000000, 0x00000000058d0000},
    {0x00000000058d0000, 0x00000000058d0000, 0x3ff0000000000000},
    {0xc17312d000000000, 0x00000000058d0000, 0xfff0000000000000},
    {0xc060000000000000, 0x00000000058d0000, 0xfff0000000000000},
    {0x0000000000000000, 0x00000000058d0000, 0x0000000000000000},
    {0x413458550295fc56, 0x00000000058d0000, 0x7ff0000000000000},
    {0x4060000000000000, 0x00000000058d0000, 0x7ff0000000000000},
    {0x3ff0000000000000, 0x00000000058d0000, 0x7ff0000000000000},
    {0xffff000000001100, 0x419fd6b71c000000, 0xffff000000001100},
    {0x41c1b06d42800000, 0x7fff000000000000, 0x7fff000000000000},
    {0x40b9fd3851eb851f, 0x402511eb851eb852, 0x4083bc47711dc477},
    {0x403136872b020c4a, 0x40f9c0bdc28f5c28, 0x3f2563753b14f6c6},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x0163400000000000, 0xc17312d000000000, 0x800204bcfe22b02e},
    {0x0163400000000000, 0xc060000000000000, 0x80f3400000000000},
    {0x0163400000000000, 0xbeb0c6f7a0b5ed8d, 0x82a25bb500000000},
    {0x0163400000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0x0163400000000000, 0x413458550295fc56, 0x001e47135f2d84f4},
    {0x0163400000000000, 0x4060000000000000, 0x00f3400000000000},
    {0x0163400000000000, 0x3ff0000000000000, 0x0163400000000000},
    {0x0163400000000000, 0x0163400000000000, 0x3ff0000000000000},
    {0xc17312d000000000, 0x0163400000000000, 0xfff0000000000000},
    {0xc060000000000000, 0x0163400000000000, 0xfeea98ef606a63be},
    {0x0000000000000000, 0x0163400000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0163400000000000, 0x7fc0e900d6edb3d0},
    {0x4060000000000000, 0x0163400000000000, 0x7eea98ef606a63be},
    {0x3ff0000000000000, 0x0163400000000000, 0x7e7a98ef606a63be},
    {0xffff000000001100, 0x41af2f33e2000000, 0xffff000000001100},
    {0x41a0c38c80000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x4101d8570a3d70a4, 0x40345f7ced916873, 0x40bc0785423bc991},
    {0x402750e560418937, 0x411fef69ffffffff, 0x3ef75d0164ea8787},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x58d0000000000000, 0xc17312d000000000, 0xd74ad7f29abcaf48},
    {0x58d0000000000000, 0xc060000000000000, 0xd860000000000000},
    {0x58d0000000000000, 0xbeb0c6f7a0b5ed8d, 0xda0e848000000000},
    {0x58d0000000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0x58d0000000000000, 0x413458550295fc56, 0x57892a73d76ba706},
    {0x58d0000000000000, 0x4060000000000000, 0x5860000000000000},
    {0x41b4639ed0000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x41175fbaeb851eb8, 0x4007a3d70a3d70a4, 0x40ffa3cdce9e89be},
    {0x403e8147ae147ae1, 0x41205810a3d70a3d, 0x3f0ddce99a8cf1ad},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x0000000000000b19, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000b19, 0xc060000000000000, 0x8000000000000016},
    {0x0000000000000b19, 0xbeb0c6f7a0b5ed8d, 0x80000000a9563840},
    {0x0000000000000b19, 0x0000000000000000, 0x7ff0000000000000},
    {0x0000000000000b19, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000b19, 0x4060000000000000, 0x0000000000000016},
    {0x0000000000000b19, 0x3ff0000000000000, 0x0000000000000b19},
    {0x0000000000000b19, 0x0000000000000b19, 0x3ff0000000000000},
    {0xc17312d000000000, 0x0000000000000b19, 0xfff0000000000000},
    {0xc060000000000000, 0x0000000000000b19, 0xfff0000000000000},
    {0x0000000000000000, 0x0000000000000b19, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000b19, 0x7ff0000000000000},
    {0x4060000000000000, 0x0000000000000b19, 0x7ff0000000000000},
    {0x3ff0000000000000, 0x0000000000000b19, 0x7ff0000000000000},
    {0xffff000000001100, 0x4166829820000000, 0xffff000000001100},
    {0x41aa16b916000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x411e1dcad70a3d71, 0x40242353f7ced917, 0x40e7ed91450717ec},
    {0x3fc6a7ef9db22d0e, 0x40cc37d851eb851e, 0x3ee9b14175a4f823},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x00000000058c8000, 0xc17312d000000000, 0x8000000000000005},
    {0x00000000058c8000, 0xc060000000000000, 0x80000000000b1900},
    {0x00000000058c8000, 0xbeb0c6f7a0b5ed8d, 0x800054ab1c200000},
    {0x00000000058c8000, 0x0000000000000000, 0x7ff0000000000000},
    {0x00000000058c8000, 0x413458550295fc56, 0x0000000000000046},
    {0x00000000058c8000, 0x4060000000000000, 0x00000000000b1900},
    {0x00000000058c8000, 0x3ff0000000000000, 0x00000000058c8000},
    {0x00000000058c8000, 0x00000000058c8000, 0x3ff0000000000000},
    {0xc17312d000000000, 0x00000000058c8000, 0xfff0000000000000},
    {0xc060000000000000, 0x00000000058c8000, 0xfff0000000000000},
    {0x0000000000000000, 0x00000000058c8000, 0x0000000000000000},
    {0x413458550295fc56, 0x00000000058c8000, 0x7ff0000000000000},
    {0x4060000000000000, 0x00000000058c8000, 0x7ff0000000000000},
    {0x3ff0000000000000, 0x00000000058c8000, 0x7ff0000000000000},
    {0xffff000000001100, 0x41ac1e2b90000000, 0xffff000000001100},
    {0x41b112678b000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x4116be493d70a3d7, 0x403d26e978d4fdf4, 0x40c8f717e984eaec},
    {0x40312b020c49ba5e, 0x411ed5fbb851eb85, 0x3f01d0ee178b3991},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x0163200000000000, 0xc17312d000000000, 0x80020161ffcf5898},
    {0x0163200000000000, 0xc060000000000000, 0x80f3200000000000},
    {0x0163200000000000, 0xbeb0c6f7a0b5ed8d, 0x82a23d3080000000},
    {0x0163200000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0x0163200000000000, 0x413458550295fc56, 0x001e14be777eada6},
    {0x0163200000000000, 0x4060000000000000, 0x00f3200000000000},
    {0x0163200000000000, 0x3ff0000000000000, 0x0163200000000000},
    {0x0163200000000000, 0x0163200000000000, 0x3ff0000000000000},
    {0xc17312d000000000, 0x0163200000000000, 0xfff0000000000000},
    {0xc060000000000000, 0x0163200000000000, 0xfeeac5701ac5701b},
    {0x0000000000000000, 0x0163200000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0163200000000000, 0x7fc1054c23a09d90},
    {0x4060000000000000, 0x0163200000000000, 0x7eeac5701ac5701b},
    {0x3ff0000000000000, 0x0163200000000000, 0x7e7ac5701ac5701b},
    {0xffff000000001100, 0x417cdb4760000000, 0xffff000000001100},
    {0x41bacc435a000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x40f463dd70a3d70a, 0x402289374bc6a7f0, 0x40c199b5c0947ed6},
    {0x402c90624dd2f1aa, 0x40cfbb8ccccccccc, 0x3f4ccdffbfafc60f},
    {0x0000000000000001, 0x0000000000000001, 0x3ff0000000000000},
    {0x58c8000000000000, 0xc17312d000000000, 0xd74421f5f40d8376},
    {0x58c8000000000000, 0xc060000000000000, 0xd858000000000000},
    {0x58c8000000000000, 0xbeb0c6f7a0b5ed8d, 0xda06e36000000000},
    {0x58c8000000000000, 0x0000000000000000, 0x7ff0000000000000},
    {0x58c8000000000000, 0x413458550295fc56, 0x5782dfd6e190bd45},
    {0x58c8000000000000, 0x4060000000000000, 0x5858000000000000},
    {0x58c8000000000000, 0x3ff0000000000000, 0x58c8000000000000},
    {0x58c8000000000000, 0x58c8000000000000, 0x3ff0000000000000},
    {0xc17312d000000000, 0x58c8000000000000, 0xa8996e6aaaaaaaab},
    {0xc060000000000000, 0x58c8000000000000, 0xa785555555555555},
    {0x0000000000000000, 0x58c8000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x58c8000000000000, 0x285b207158c7fb1d},
    {0x4060000000000000, 0x58c8000000000000, 0x2785555555555555}
};
const size_t FDIV_LENGTH = sizeof(FDIV_TESTS) / sizeof(FpuTestType);
#endif  // ENABLE_FDIV_TESTS


#ifdef ENABLE_FMUL_TESTS
static const FpuTestType FMUL_TESTS[] = {
    {0x0000000000000001, 0xc17312d000000000, 0x8000000001312d00},
    {0x4024a5604189374c, 0xc015554c985f06f7, 0xc04b871fbb872a2c},
    {0x7ffdd92a4fa86188, 0xfff527d430c40dfb, 0xfffd27d430c40dfb},
    {0xfff83dbe1a26a815, 0xffff0d13540abcd1, 0xffff0d13540abcd1},
    {0x3fffffffffffffff, 0x3fffffffffffffff, 0x400ffffffffffffe},
    {0x0000000000000000, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000000, 0x4060000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x0000000000000000},
    {0x3fffffffffffffff, 0xc060000000000000, 0xc06fffffffffffff},
    {0xc17312d000000000, 0x0000000000000000, 0x8000000000000000},
    {0xc060000000000000, 0x0000000000000000, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x0000000000000000},
    {0x4060000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xffff000000001100, 0x4136705100000000, 0xffff000000001100},
    {0x4179062540000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x410b543a8f5c28f6, 0x400f374bc6a7ef9e, 0x412aa8d2369984a1},
    {0x3fd2b020c49ba5e3, 0x410a67cc51eb851e, 0x40eed771b7bf1e8d},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000000000000000, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000000, 0xc060000000000000, 0x8000000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000000, 0x4060000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0x8000000000000000},
    {0xc060000000000000, 0x0000000000000000, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x0000000000000000},
    {0x4060000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xffff000000001100, 0x41cc509cf9000000, 0xffff000000001100},
    {0x4190d62860000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x411a6f79f5c28f5c, 0x401b78d4fdf3b646, 0x4146b1e0e5087011},
    {0x403ba4dd2f1a9fbf, 0x412169da47ae147b, 0x416e160e0faf6407},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000000000000000, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000000, 0xc060000000000000, 0x8000000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000000, 0x4060000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0x8000000000000000},
    {0xc060000000000000, 0x0000000000000000, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x0000000000000000},
    {0x4060000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xffff000000001100, 0x41c28668a8000000, 0xffff000000001100},
    {0x41997e1c88000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x410cb99c00000000, 0x402e03126e978d50, 0x414af0c4324dd2f2},
    {0x4038649ba5e353f8, 0x40ee43f1eb851eb8, 0x4137121cfaa4fca4},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000000000000000, 0xc17312d000000000, 0x8000000000000000},
    {0x0000000000000000, 0xc060000000000000, 0x8000000000000000},
    {0x0000000000000000, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x413458550295fc56, 0x0000000000000000},
    {0x0000000000000000, 0x4060000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x3ff0000000000000, 0x0000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000000, 0x8000000000000000},
    {0xc060000000000000, 0x0000000000000000, 0x8000000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000000, 0x0000000000000000},
    {0x4060000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x3ff0000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xffff000000001100, 0x4180006560000000, 0xffff000000001100},
    {0x41930f4ff4000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x40f15cbdeb851eb8, 0x403da872b020c49c, 0x414017713c7991bc},
    {0x4023dc28f5c28f5c, 0x410dce91851eb851, 0x41427fb8b69e1b08},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000000000000001, 0xc060000000000000, 0x8000000000000080},
    {0x0000000000000001, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000001, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000001, 0x413458550295fc56, 0x0000000000145855},
    {0x0000000000000001, 0x4060000000000000, 0x0000000000000080},
    {0x0000000000000001, 0x3ff0000000000000, 0x0000000000000001},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000001, 0x8000000001312d00},
    {0xc060000000000000, 0x0000000000000001, 0x8000000000000080},
    {0x0000000000000000, 0x0000000000000001, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000001, 0x0000000000145855},
    {0x4060000000000000, 0x0000000000000001, 0x0000000000000080},
    {0x3ff0000000000000, 0x0000000000000001, 0x0000000000000001},
    {0xffff000000001100, 0x41b8d4ee24000000, 0xffff000000001100},
    {0x41b5f5621a000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x41068da947ae147b, 0x403b59999999999a, 0x415346ad14dd2f1b},
    {0x4030f0e560418937, 0x411729f91eb851eb, 0x415886bacb9d5e49},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000000000008000, 0xc17312d000000000, 0x8000009896800000},
    {0x0000000000008000, 0xc060000000000000, 0x8000000000400000},
    {0x0000000000008000, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000008000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000008000, 0x413458550295fc56, 0x0000000a2c2a814b},
    {0x0000000000008000, 0x4060000000000000, 0x0000000000400000},
    {0x0000000000008000, 0x3ff0000000000000, 0x0000000000008000},
    {0x0000000000008000, 0x0000000000008000, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000008000, 0x8000009896800000},
    {0xc060000000000000, 0x0000000000008000, 0x8000000000400000},
    {0x0000000000000000, 0x0000000000008000, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000008000, 0x0000000a2c2a814b},
    {0x4060000000000000, 0x0000000000008000, 0x0000000000400000},
    {0x3ff0000000000000, 0x0000000000008000, 0x0000000000008000},
    {0xffff000000001100, 0x41a3190398000000, 0xffff000000001100},
    {0x41a97e881c000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x40caf28000000000, 0x40404ba5e353f7cf, 0x411b71e81ba5e354},
    {0x3ffa7ae147ae147b, 0x41129062cccccccc, 0x411eb932dfbe76c8},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x3ff0000000000000, 0x58c8000000000000, 0x58c8000000000000},
    {0xffff000000001100, 0x41b9c0d8c0000000, 0xffff000000001100},
    {0x41b72aa22a000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x4113d77feb851eb8, 0x403070a3d70a3d71, 0x4154632f99096bba},
    {0x4031020c49ba5e35, 0x4104dfa2e147ae14, 0x414630490ba1f4b1},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000000000000b1a, 0xc17312d000000000, 0x8000000d3bed9200},
    {0x0000000000000b1a, 0xc060000000000000, 0x8000000000058d00},
    {0x0000000000000b1a, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000b1a, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000b1a, 0x413458550295fc56, 0x00000000e1dc9fbf},
    {0x0000000000000b1a, 0x4060000000000000, 0x0000000000058d00},
    {0x0000000000000b1a, 0x3ff0000000000000, 0x0000000000000b1a},
    {0x0000000000000b1a, 0x0000000000000b1a, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000b1a, 0x8000000d3bed9200},
    {0xc060000000000000, 0x0000000000000b1a, 0x8000000000058d00},
    {0x0000000000000000, 0x0000000000000b1a, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000b1a, 0x00000000e1dc9fbf},
    {0x4060000000000000, 0x0000000000000b1a, 0x0000000000058d00},
    {0x3ff0000000000000, 0x0000000000000b1a, 0x0000000000000b1a},
    {0xffff000000001100, 0x419a6be460000000, 0xffff000000001100},
    {0x41a00fb4bc000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x410b4b9b0a3d70a4, 0x40392d916872b021, 0x415579ef79b47843},
    {0x40325ef9db22d0e5, 0x40e79ecdc28f5c29, 0x412b1edd4e9b7bf1},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x00000000058d0000, 0xc17312d000000000, 0x80069df6c9000000},
    {0x00000000058d0000, 0xc060000000000000, 0x80000002c6800000},
    {0x00000000058d0000, 0xbeb0c6f7a0b5ed8d, 0x800000000000005d},
    {0x00000000058d0000, 0x0000000000000000, 0x0000000000000000},
    {0x00000000058d0000, 0x413458550295fc56, 0x000070ee4fdf5a8a},
    {0x00000000058d0000, 0x4060000000000000, 0x00000002c6800000},
    {0x00000000058d0000, 0x3ff0000000000000, 0x00000000058d0000},
    {0x00000000058d0000, 0x00000000058d0000, 0x0000000000000000},
    {0xc17312d000000000, 0x00000000058d0000, 0x80069df6c9000000},
    {0xc060000000000000, 0x00000000058d0000, 0x80000002c6800000},
    {0x0000000000000000, 0x00000000058d0000, 0x0000000000000000},
    {0x413458550295fc56, 0x00000000058d0000, 0x000070ee4fdf5a8a},
    {0x4060000000000000, 0x00000000058d0000, 0x00000002c6800000},
    {0x3ff0000000000000, 0x00000000058d0000, 0x00000000058d0000},
    {0xffff000000001100, 0x419fd6b71c000000, 0xffff000000001100},
    {0x41c1b06d42800000, 0x7fff000000000000, 0x7fff000000000000},
    {0x40b9fd3851eb851f, 0x402511eb851eb852, 0x40f11cbac3611341},
    {0x403136872b020c4a, 0x40f9c0bdc28f5c28, 0x413bb48daea35935},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0163400000000000, 0xc17312d000000000, 0x82e6f2a240000000},
    {0x0163400000000000, 0xc060000000000000, 0x81d3400000000000},
    {0x0163400000000000, 0xbeb0c6f7a0b5ed8d, 0x80242f61ed5ae1ce},
    {0x0163400000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0163400000000000, 0x413458550295fc56, 0x02a87a46471c7397},
    {0x0163400000000000, 0x4060000000000000, 0x01d3400000000000},
    {0x0163400000000000, 0x3ff0000000000000, 0x0163400000000000},
    {0x0163400000000000, 0x0163400000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0163400000000000, 0x82e6f2a240000000},
    {0xc060000000000000, 0x0163400000000000, 0x81d3400000000000},
    {0x0000000000000000, 0x0163400000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0163400000000000, 0x02a87a46471c7397},
    {0x4060000000000000, 0x0163400000000000, 0x01d3400000000000},
    {0x3ff0000000000000, 0x0163400000000000, 0x0163400000000000},
    {0xffff000000001100, 0x41af2f33e2000000, 0xffff000000001100},
    {0x41a0c38c80000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x4101d8570a3d70a4, 0x40345f7ced916873, 0x4146b8eca732df51},
    {0x402750e560418937, 0x411fef69ffffffff, 0x415744cfa25e353e},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x58d0000000000000, 0xc17312d000000000, 0xda5312d000000000},
    {0x58d0000000000000, 0xc060000000000000, 0xd940000000000000},
    {0x58d0000000000000, 0xbeb0c6f7a0b5ed8d, 0xd790c6f7a0b5ed8d},
    {0x58d0000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x58d0000000000000, 0x413458550295fc56, 0x5a1458550295fc56},
    {0x58d0000000000000, 0x4060000000000000, 0x5940000000000000},
    {0x41b4639ed0000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x41175fbaeb851eb8, 0x4007a3d70a3d70a4, 0x4131447b0c1205bc},
    {0x403e8147ae147ae1, 0x41205810a3d70a3d, 0x416f292e71f8a08f},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0000000000000b19, 0xc17312d000000000, 0x8000000d3abc6500},
    {0x0000000000000b19, 0xc060000000000000, 0x8000000000058c80},
    {0x0000000000000b19, 0xbeb0c6f7a0b5ed8d, 0x8000000000000000},
    {0x0000000000000b19, 0x0000000000000000, 0x0000000000000000},
    {0x0000000000000b19, 0x413458550295fc56, 0x00000000e1c8476a},
    {0x0000000000000b19, 0x4060000000000000, 0x0000000000058c80},
    {0x0000000000000b19, 0x3ff0000000000000, 0x0000000000000b19},
    {0x0000000000000b19, 0x0000000000000b19, 0x0000000000000000},
    {0xc17312d000000000, 0x0000000000000b19, 0x8000000d3abc6500},
    {0xc060000000000000, 0x0000000000000b19, 0x8000000000058c80},
    {0x0000000000000000, 0x0000000000000b19, 0x0000000000000000},
    {0x413458550295fc56, 0x0000000000000b19, 0x00000000e1c8476a},
    {0x4060000000000000, 0x0000000000000b19, 0x0000000000058c80},
    {0x3ff0000000000000, 0x0000000000000b19, 0x0000000000000b19},
    {0xffff000000001100, 0x4166829820000000, 0xffff000000001100},
    {0x41aa16b916000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x411e1dcad70a3d71, 0x40242353f7ced917, 0x4152f3de62c05922},
    {0x3fc6a7ef9db22d0e, 0x40cc37d851eb851e, 0x40a3fa7b7564302a},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x00000000058c8000, 0xc17312d000000000, 0x80069d5e32800000},
    {0x00000000058c8000, 0xc060000000000000, 0x80000002c6400000},
    {0x00000000058c8000, 0xbeb0c6f7a0b5ed8d, 0x800000000000005d},
    {0x00000000058c8000, 0x0000000000000000, 0x0000000000000000},
    {0x00000000058c8000, 0x413458550295fc56, 0x000070e423b4d93f},
    {0x00000000058c8000, 0x4060000000000000, 0x00000002c6400000},
    {0x00000000058c8000, 0x3ff0000000000000, 0x00000000058c8000},
    {0x00000000058c8000, 0x00000000058c8000, 0x0000000000000000},
    {0xc17312d000000000, 0x00000000058c8000, 0x80069d5e32800000},
    {0xc060000000000000, 0x00000000058c8000, 0x80000002c6400000},
    {0x0000000000000000, 0x00000000058c8000, 0x0000000000000000},
    {0x413458550295fc56, 0x00000000058c8000, 0x000070e423b4d93f},
    {0x4060000000000000, 0x00000000058c8000, 0x00000002c6400000},
    {0x3ff0000000000000, 0x00000000058c8000, 0x00000000058c8000},
    {0xffff000000001100, 0x41ac1e2b90000000, 0xffff000000001100},
    {0x41b112678b000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x4116be493d70a3d7, 0x403d26e978d4fdf4, 0x4164b81a460d4563},
    {0x40312b020c49ba5e, 0x411ed5fbb851eb85, 0x41608b1f3d6238da},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x0163200000000000, 0xc17312d000000000, 0x82e6cc7ca0000000},
    {0x0163200000000000, 0xc060000000000000, 0x81d3200000000000},
    {0x0163200000000000, 0xbeb0c6f7a0b5ed8d, 0x80240dd3fe1975f3},
    {0x0163200000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0163200000000000, 0x413458550295fc56, 0x02a851959d17479f},
    {0x0163200000000000, 0x4060000000000000, 0x01d3200000000000},
    {0x0163200000000000, 0x3ff0000000000000, 0x0163200000000000},
    {0x0163200000000000, 0x0163200000000000, 0x0000000000000000},
    {0xc17312d000000000, 0x0163200000000000, 0x82e6cc7ca0000000},
    {0xc060000000000000, 0x0163200000000000, 0x81d3200000000000},
    {0x0000000000000000, 0x0163200000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x0163200000000000, 0x02a851959d17479f},
    {0x4060000000000000, 0x0163200000000000, 0x01d3200000000000},
    {0x3ff0000000000000, 0x0163200000000000, 0x0163200000000000},
    {0xffff000000001100, 0x417cdb4760000000, 0xffff000000001100},
    {0x41bacc435a000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x40f463dd70a3d70a, 0x402289374bc6a7f0, 0x41279f36aea747d8},
    {0x402c90624dd2f1aa, 0x40cfbb8ccccccccc, 0x410c5348a858793d},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000000},
    {0x58c8000000000000, 0xc17312d000000000, 0xda4c9c3800000000},
    {0x58c8000000000000, 0xc060000000000000, 0xd938000000000000},
    {0x58c8000000000000, 0xbeb0c6f7a0b5ed8d, 0xd7892a737110e454},
    {0x58c8000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x58c8000000000000, 0x413458550295fc56, 0x5a0e847f83e0fa81},
    {0x58c8000000000000, 0x4060000000000000, 0x5938000000000000},
    {0x58c8000000000000, 0x3ff0000000000000, 0x58c8000000000000},
    {0x58c8000000000000, 0x58c8000000000000, 0x71a2000000000000},
    {0xc17312d000000000, 0x58c8000000000000, 0xda4c9c3800000000},
    {0xc060000000000000, 0x58c8000000000000, 0xd938000000000000},
    {0x0000000000000000, 0x58c8000000000000, 0x0000000000000000},
    {0x413458550295fc56, 0x58c8000000000000, 0x5a0e847f83e0fa81},
    {0x4060000000000000, 0x58c8000000000000, 0x5938000000000000}
};
const size_t FMUL_LENGTH = sizeof(FMUL_TESTS) / sizeof(FpuTestType);
#endif  // ENABLE_FMUL_TESTS


#ifdef ENABLE_FMAX_TESTS
static const FpuTestType FMAX_TESTS[] = {
    {0x0000000003a08000, 0x413458550295fc56, 0x413458550295fc56},
    {0x0000000003a08000, 0x4060000000000000, 0x4060000000000000},
    {0x0000000003a08000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0000000003a08000, 0x0000000003a08000, 0x0000000003a08000},
    {0xc17312d000000000, 0x0000000003a08000, 0x0000000003a08000},
    {0xc060000000000000, 0x0000000003a08000, 0x0000000003a08000},
    {0x0000000000000000, 0x0000000003a08000, 0x0000000003a08000},
    {0x413458550295fc56, 0x0000000003a08000, 0x413458550295fc56},
    {0x4060000000000000, 0x0000000003a08000, 0x4060000000000000},
    {0x3ff0000000000000, 0x0000000003a08000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41a468cad0000000, 0x41a468cad0000000},
    {0x4179bf6870000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000001},
    {0x00e8200000000000, 0xc17312d000000000, 0x00e8200000000000},
    {0x00e8200000000000, 0xc060000000000000, 0x00e8200000000000},
    {0x00e8200000000000, 0xbeb0c6f7a0b5ed8d, 0x00e8200000000000},
    {0x00e8200000000000, 0x0000000000000000, 0x00e8200000000000},
    {0x00e8200000000000, 0x413458550295fc56, 0x413458550295fc56},
    {0x00e8200000000000, 0x4060000000000000, 0x4060000000000000},
    {0x00e8200000000000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x00e8200000000000, 0x00e8200000000000, 0x00e8200000000000},
    {0xc17312d000000000, 0x00e8200000000000, 0x00e8200000000000},
    {0xc060000000000000, 0x00e8200000000000, 0x00e8200000000000},
    {0x0000000000000000, 0x00e8200000000000, 0x00e8200000000000},
    {0x413458550295fc56, 0x00e8200000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x00e8200000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x00e8200000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41c0a5e9a9800000, 0x41c0a5e9a9800000},
    {0x4141757900000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000001},
    {0x3a08000000000000, 0xc17312d000000000, 0x3a08000000000000},
    {0x3a08000000000000, 0xc060000000000000, 0x3a08000000000000},
    {0x3a08000000000000, 0xbeb0c6f7a0b5ed8d, 0x3a08000000000000},
    {0x3a08000000000000, 0x0000000000000000, 0x3a08000000000000},
    {0x3a08000000000000, 0x413458550295fc56, 0x413458550295fc56},
    {0x3a08000000000000, 0x4060000000000000, 0x4060000000000000},
    {0x3a08000000000000, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x3a08000000000000, 0x3a08000000000000, 0x3a08000000000000},
    {0xc17312d000000000, 0x3a08000000000000, 0x3a08000000000000},
    {0xc060000000000000, 0x3a08000000000000, 0x3a08000000000000},
    {0x0000000000000000, 0x3a08000000000000, 0x3a08000000000000},
    {0x413458550295fc56, 0x3a08000000000000, 0x413458550295fc56},
    {0x4060000000000000, 0x3a08000000000000, 0x4060000000000000},
    {0x3ff0000000000000, 0x3a08000000000000, 0x3ff0000000000000},
    {0xffff000000001100, 0x41bb113a18000000, 0x41bb113a18000000},
    {0x41b0be5840000000, 0x7fff000000000000, 0x7fff000000000000},
    {0x0000000000000001, 0x0000000000000001, 0x0000000000000001},
    {0x0000000000000742, 0xc17312d000000000, 0x0000000000000742},
    {0x0000000000000742, 0xc060000000000000, 0x0000000000000742},
    {0x0000000000000742, 0xbeb0c6f7a0b5ed8d, 0x0000000000000742},
    {0x0000000000000742, 0x0000000000000000, 0x0000000000000742},
    {0x0000000000000742, 0x413458550295fc56, 0x413458550295fc56},
    {0x0000000000000742, 0x4060000000000000, 0x4060000000000000},
    {0x0000000000000742, 0x3ff0000000000000, 0x3ff0000000000000},
    {0x0000000000000742, 0x0000000000000742, 0x0000000000000742},
    {0xc17312d000000000, 0x0000000000000742, 0x0000000000000742},
    {0xc060000000000000, 0x0000000000000742, 0x0000000000000742}
};
const size_t FMAX_LENGTH = sizeof(FMAX_TESTS) / sizeof(FpuTestType);
#endif  // ENABLE_FMAX_TESTS

#ifdef ENABLE_FCVT_D_W_TESTS
static const FpuTestType FCVT_D_W_TESTS[] = {
    {0x00000000ffffffff, 0x0000000000000000, 0xbff0000000000000},
    {0x000000007fffffff, 0x0000000000000000, 0x41dfffffffc00000},
    {0x0000000080000000, 0x0000000000000000, 0xc1e0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000080000001, 0x0000000000000000, 0xc1dfffffffc00000},
    {0x0000000000000001, 0x0000000000000000, 0x3ff0000000000000},
    {0x4a11dedd93d069ae, 0x0000000000000000, 0xc1db0be594800000}
};
const size_t FCVT_D_W_LENGTH = sizeof(FCVT_D_W_TESTS) / sizeof(FpuTestType);
#endif  // ENABLE_FCVT_D_W_TESTS

#ifdef ENABLE_FCVT_D_WU_TESTS
static const FpuTestType FCVT_D_WU_TESTS[] = {
    {0x00000000ffffffff, 0x0000000000000000, 0x41efffffffe00000},
    {0x000000007fffffff, 0x0000000000000000, 0x41dfffffffc00000},
    {0x0000000080000000, 0x0000000000000000, 0x41e0000000000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x0000000080000001, 0x0000000000000000, 0x41e0000000200000},
    {0x0000000000000001, 0x0000000000000000, 0x3ff0000000000000},
    {0x4a11dedd93d069ae, 0x0000000000000000, 0x41e27a0d35c00000}
};
const size_t FCVT_D_WU_LENGTH = sizeof(FCVT_D_WU_TESTS) / sizeof(FpuTestType);
#endif  // ENABLE_FCVT_D_WU_TESTS

#ifdef ENABLE_FCVT_W_D_TESTS
static const FpuTestType FCVT_W_D_TESTS[] = {
    {0x43e93bf4be560070, 0x0000000000000000, 0xffffffff80000000},
    {0x3fffffffffffffff, 0x0000000000000000, 0x0000000000000001},
    {0x38ffffffffffffff, 0x0000000000000000, 0x0000000000000000},
    {0x41dfffffffffffff, 0x0000000000000000, 0x000000007fffffff},
    {0x41e0000000000000, 0x0000000000000000, 0xffffffff80000000},
    {0x41f0000000000000, 0x0000000000000000, 0xffffffff80000000},
    {0xc1dfffffffffffff, 0x0000000000000000, 0xffffffff80000001},
    {0xc1e0000000000000, 0x0000000000000000, 0xffffffff80000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x8000000000000000, 0x0000000000000000, 0x0000000000000000}
};
const size_t FCVT_W_D_LENGTH = sizeof(FCVT_W_D_TESTS) / sizeof(FpuTestType);
#endif  // ENABLE_FCVT_W_D_TESTS

#ifdef ENABLE_FCVT_WU_D_TESTS
static const FpuTestType FCVT_WU_D_TESTS[] = {
    {0x43e93bf4be560070, 0x0000000000000000, 0x0000000000000000},
    {0x3fffffffffffffff, 0x0000000000000000, 0x0000000000000001},
    {0x38ffffffffffffff, 0x0000000000000000, 0x0000000000000000},
    {0x41dfffffffffffff, 0x0000000000000000, 0x000000007fffffff},
    {0x41e0000000000000, 0x0000000000000000, 0x0000000080000000},
    {0x41f0000000000000, 0x0000000000000000, 0x0000000000000000},
    {0xc1dfffffffffffff, 0x0000000000000000, 0x0000000080000001},
    {0xc1e0000000000000, 0x0000000000000000, 0x0000000080000000},
    {0x0000000000000000, 0x0000000000000000, 0x0000000000000000},
    {0x8000000000000000, 0x0000000000000000, 0x0000000000000000}
};
const size_t FCVT_WU_D_LENGTH = sizeof(FCVT_WU_D_TESTS) / sizeof(FpuTestType);
#endif  // ENABLE_FCVT_WU_D_TESTS

#endif  // __BOOTROM_TESTS_SRC_TEST_FPU_H__

